package o;

import android.content.Context;
import com.huawei.appgallery.foundation.account.bean.UserSession;
import com.huawei.gamebox.plugin.gameservice.bean.GameInfo;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant.KeyAndValue;
import o.beo.f;

public class bfs {
    private static bfs ˏ = null;

    static class d implements ccw {
        d() {
        }

        public ccr ˏ() {
            ccr o_ccr = new ccr();
            o_ccr.ˋ(19000001);
            o_ccr.ॱ(true);
            o_ccr.ˊ(1);
            o_ccr.ˋ(false);
            o_ccr.ˏ(true);
            o_ccr.ˎ(true);
            return o_ccr;
        }

        public void ˋ(boolean z, ccm o_ccm) {
        }
    }

    private bfs() {
    }

    public static bfs ˋ() {
        if (ˏ == null) {
            ˏ = new bfs();
        }
        return ˏ;
    }

    public void ˎ(Context context) {
        Logger.ˏ("BuoyAccountManagerHelper", "start silentLogin.");
        ˏ(context);
    }

    public void ॱ(Context context) {
        bga.ॱ().ˊ(null, "login|buoy", null, false);
        fae ˏ = fam.ॱ().ˏ();
        if (ˏ != null) {
            GameInfo gameInfo = ˏ.getGameInfo();
            if (gameInfo != null) {
                dgh.ॱ(ContentManager.getInstant().getContext(), "15150506", new StringBuffer().append(KeyAndValue.NUMBER_01).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(UserSession.getInstance().getUserId()).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(gameInfo.getPackageName()).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(gameInfo.getAppId()).append(HiAnalyticsConstant.REPORT_VAL_SEPARATOR).append(gameInfo.getSdkVersionCode()).toString());
            }
        }
    }

    private void ˏ(Context context) {
        if (Logger.ˎ()) {
            Logger.ˏ("BuoyAccountManagerHelper", "enter loginDirectly");
        }
        if (!ॱ(context, true)) {
            eod.ˊ(context, new d(), false, true, false);
        } else if (Logger.ˎ()) {
            Logger.ˏ("BuoyAccountManagerHelper", "login no network");
        }
    }

    private boolean ॱ(Context context, boolean z) {
        if (doo.ˊ(context)) {
            return false;
        }
        if (z) {
            evk.ˋ(context, context.getResources().getString(f.ﹳ), 0).ˋ();
        }
        return true;
    }
}
